#include<iostream>

using namespace std;

int n , m;
const int N = 5e4 + 10;
int f[N];
int main()
{
    cin >> n >> m;
    for(int i = 1;i <= n;i ++)
    {
        int x; cin >> x;
        f[i] = f[i-1] + x;
    }
    while(m--)
    {
        int y; cin >> y;
        int l = 1 , r = n;
        while(l < r)
        {
            int mid = (l + r) / 2;
            if(f[mid] > y) r = mid;
            else l = mid + 1;
        }
        cout << l << endl;
    }
    return 0;
}